var lis = document.getElementById("topp-left-cottot").getElementsByTagName("li");
var divs = document.getElementsByClassName("topp-left-xia");
//console.log(lis);
//console.log(divs);
//最近更新
for(var i = 0; i < lis.length; i++) {
	lis[i].index = i;
	lis[i].onclick = function() {
		for(var j = 0; j < lis.length; j++) {
			lis[j].style.backgroundColor = "";
			lis[j].style.color = "";
			divs[j].style.display = "none";
		}
		this.style.backgroundColor = "rgb(153,97,47)";
		this.style.color = "white";
		divs[this.index].style.display = "block";
	}
}
var spans = document.getElementById("span").getElementsByTagName("span");
var dovs = document.getElementsByClassName("topp-right-toppp")[0];
//console.log(spans);
//console.log(dovs);
//右图大
// var num=0;
// var timer=null;
// timer =setInterval(autoPaly,20);
//	function autoPaly(){
//	num-=3;
//	if (num>=-2240) {
//		dovs.style.left=num+"px";
//	}else{
//		num=0;
// }
//}
//dovs.onmouseover=function(){
//		 clearInterval(timer);
//		  }
//dovs.onmouseout=function(){
//		timer =setInterval(autoPaly,20);
//}
for(var i = 0; i < spans.length; i++) {
	spans[i].index = i;
	spans[i].onclick = function() {
		for(var j = 0; j < spans.length; j++) {
			spans[j].style.backgroundColor = "";
			dovs.style.left=0;
		}
		this.style.backgroundColor = "red";
		dovs.style.left = -560 * this.index + "px";
	}
}
//右图下
$(".topp-right-zhong-right span").click(function(){
	$(".topp-right-zhong-right span").css("background-color","");
	$(this).css("background-color","orangered");
	$(".zhuanti-zhuanti img").attr("src","img/zt"+($(this).index()+1)+".jpg");
});
//魔兽视频
$(".shipin li").mouseover(function(){
	$(".content-left").css("display","none");
	$(".content-left").eq($(this).index()).css("display","block");
});
//点击排行榜
var liIndex;
for (var i = 0; i < $('.content-right li').length; i++) {
	$('.content-right li').eq(i).prepend($('<span class="span-span">' + (i%10+1) + '</span>'));
}
$(".b2 li").mouseover(function(){
	$(".content-right ul").css("display","none");
	$(".content-right ul").eq($(this).index()).css("display","block");
});
//12职业
$(".xia-top-xia li").mouseover(function(){
	$(".xia-xia").css("display","none");
	$(".xia-xia").eq($(this).index()).css("display","block");
})
//魔兽图片
//$('.bottom-xia:first').css('display','block');
$(".bottom-top li").mouseover(function(){
	$(".bottom-xia").css("display","none");
	$(".bottom-xia").eq($(this).index()).css("display","block");
	$(".bottom-top li").css({"color":"white","backgroundColor":"rgb(173,97,47)"});
	$(".bottom-top li").eq($(this)).css({"color":"black","backgroundColor":"rgb(255,255,238)"})
});